﻿using System.Collections.ObjectModel;
using KPIS.GERP.Models.FIM;
using KPIS.GERP.Models.HRM;
using KPIS.GERP.Models.ICM;
using KPIS.GERP.Models.SYS;
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;

namespace KPIS.GERP.Models.Migrations
{
    public partial class Configuration
    {
        public void SeedFIM(GERPContext context)
        {

            context.MasBanks.AddOrUpdate(
                new MasBank
                    {
                        BankId = 1,
                        Name = "ธนาคารกรุงเทพ",
                        NameEng = "BBL",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBank
                    {
                        BankId = 2,
                        Name = "ธนาคารกรุงศรีอยุธยา",
                        NameEng = "BAY",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBank
                    {
                        BankId = 3,
                        Name = "ธนาคารกสิกรไทย",
                        NameEng = "KBANK",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBank
                    {
                        BankId = 4,
                        Name = "ธนาคารไทยพาณิชย์",
                        NameEng = "SCB",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBank
                    {
                        BankId = 5,
                        Name = "ธนาคารกรุงไทย",
                        NameEng = "KTB",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    }
                );


            context.MasBankBranchs.AddOrUpdate(
                new MasBankBranch
                    {
                        BranchId = 1,
                        BankId = 1,
                        BranchName = "บางรัก",
                        BranchNameEng = "Bankruk",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 2,
                        BankId = 1,
                        BranchName = "บางจาก",
                        BranchNameEng = "Bankjak",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 3,
                        BankId = 2,
                        BranchName = "บางกระบือ",
                        BranchNameEng = "Bankkrabue",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 4,
                        BankId = 2,
                        BranchName = "บางอ้อ",
                        BranchNameEng = "Bankaor",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 5,
                        BankId = 3,
                        BranchName = "บางใหญ่",
                        BranchNameEng = "Bangyai",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 6,
                        BankId = 3,
                        BranchName = "บางนา",
                        BranchNameEng = "Bangna",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 7,
                        BankId = 4,
                        BranchName = "บางกะปิ",
                        BranchNameEng = "Bangkapi",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 8,
                        BankId = 4,
                        BranchName = "บางคอแหลม",
                        BranchNameEng = "Bangkorleam",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 9,
                        BankId = 5,
                        BranchName = "บางภาษี",
                        BranchNameEng = "Bangpasi",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    },
                new MasBankBranch
                    {
                        BranchId = 10,
                        BankId = 5,
                        BranchName = "บางลำพู",
                        BranchNameEng = "Banglampoo",
                        RecordStatus = SYS.RecordStatus.UsedStatus,
                        CreatedBy = 1,
                        CreatedWhen = DateTime.Now
                    }
                );

            //context.FimMasLookUpTypes.AddOrUpdate(new FimMasLookUpType
            //{
            //    LookUpTypeId = 1,
            //    Name = "BankAccountType",
            //    RecordStatus = RecordStatus.UsedStatus,
            //    CreatedBy = 1,
            //    CreatedWhen = DateTime.Now
            //});

            //context.FimMasLookUps.AddOrUpdate(new FimMasLookUp
            //{
            //    LookUpId = 1,
            //    Name = "บัญชีออมทรัพย์",
            //    LookUpTypeId = 1,
            //    RecordStatus = RecordStatus.UsedStatus,
            //    CreatedBy = 1,
            //    CreatedWhen = DateTime.Now
            //});
            //context.FimMasLookUps.AddOrUpdate(new FimMasLookUp
            //{
            //    LookUpId = 2,
            //    Name = "บัญชีกระแสรายวัน",
            //    LookUpTypeId = 1,
            //    RecordStatus = RecordStatus.UsedStatus,
            //    CreatedBy = 1,
            //    CreatedWhen = DateTime.Now
            //});
            //context.FimMasLookUps.AddOrUpdate(new FimMasLookUp
            //{
            //    LookUpId = 3,
            //    Name = "บัญชีฝากประจำ",
            //    LookUpTypeId = 1,
            //    RecordStatus = RecordStatus.UsedStatus,
            //    CreatedBy = 1,
            //    CreatedWhen = DateTime.Now
            //});

            context.MasBankAccounts.AddOrUpdate(new MasBankAccount
                {
                    BankAccId = 1,
                    Name = "บัญชีออมทรัพย์ สรพ.",
                    BankAccTypeId = 1,
                    BgmSourceId = 1,
                    RecordStatus = RecordStatus.UsedStatus,
                    CreatedBy = 1,
                    CreatedWhen = DateTime.Now

                });
        }
    }
}